package entity;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.annotations.GenericGenerator;

/**
 * ArretCaisse entity.
 *
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "arret_caisse", schema = "public")
public class ArretCaisse implements java.io.Serializable {

    // Fields
    private Integer id;
    private MontantCaisse montantCaisse;
    private Date dateArret;
    private Date heureArret;
    private double montant;
    // Constructors

    /**
     * default constructor
     */
    public ArretCaisse() {
    }

    /**
     * full constructor
     */
    public ArretCaisse(MontantCaisse montantCaisse, Date dateArret,
            Date heureArret) {
        this.montantCaisse = montantCaisse;
        this.dateArret = dateArret;
        this.heureArret = heureArret;
    }

    // Property accessors
    @GenericGenerator(name = "generator", strategy = "increment")
    @Id
    @GeneratedValue(generator = "generator")
    @Column(name = "id", unique = true, nullable = false)
    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "id_montant_caisse")
    public MontantCaisse getMontantCaisse() {
        return this.montantCaisse;
    }

    public void setMontantCaisse(MontantCaisse montantCaisse) {
        this.montantCaisse = montantCaisse;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "date_arret", length = 13)
    public Date getDateArret() {
        return this.dateArret;
    }

    public void setDateArret(Date dateArret) {
        this.dateArret = dateArret;
    }

    @Column(name = "heure_arret", length = 21)
    public Date getHeureArret() {
        return this.heureArret;
    }

    public void setHeureArret(Date heureArret) {
        this.heureArret = heureArret;
    }

    @Column(name = "montant")
    public double getMontant() {
        return montant;
    }

    public void setMontant(double montant) {
        this.montant = montant;
    }
}